require 'FileUtils'

ErrorFileName = "G:\\EpiDev\\JMPeripheral\\_test\\SunWei\\JMG4Tools\\26 ReleaseJMRootG4\\ReleaseJMRootG4ErrorMsg.err"

FileUtils.rm ErrorFileName, :force => true

def logError(errorMsg)
  File.open(ErrorFileName, 'a+') { |file|
    file.puts errorMsg
  };
end

File.open('G:\\EpiDev\\JMCardG4\\public\\EpiRootG4.dpr', 'r') { |file|
  while line = file.gets
    if line.match(/HttpService_Intf in/) and not line.match(/G:\\EpiDev\\JMPeripheral\\09-ProvinceServer\\HttpService_Intf.pas/) 
      logError("HttpService_Intf 单元路径不正确")
    end;

    if line.match(/adoSQLLib in/) and not line.match(/G:\\EpiDev\\JMPeripheral\\08-EpiServerBrowser\\Lib\\adoSQLLib.pas/) 
      logError("adoSQLLib 单元路径不正确")
    end;
  end;
};